import * as types from './types.js'
export default{
    increment:({commit})=>{
        commit(types.INCREMENT)
    },
    decrement:({commit})=>{
        commit('decrement')
    },
    clickOdd:({commit,state})=>{
        console.log(state.count)
        if(state.count%2==0){
            commit('increment')
        }
    },
    async clickAsync(state){
        await setTimeout(function() {
                state.count=0
                alert()
        }, 3000);
    }
}